package com.jiangwz.aop2;

import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.jiangwz.dao.UserDao;

/**
 * @author jiangwz
 * @create 2021/2/22.
 */
public class MainTest1 {

    public static void main(String[] args){

        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.register(Config01.class);
        applicationContext.refresh();
        UserDao bean = applicationContext.getBean(UserDao.class);
        bean.query();

        Arrays.stream(applicationContext.getBeanDefinitionNames()).collect(Collectors.toList()).forEach(System.out::println);
    }
}
